/*
 * @Author: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @Date: 2025-09-22 10:35:19
 * @LastEditors: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @LastEditTime: 2025-09-30 20:52:09
 * @FilePath: /GateServer/src/net/logicsystem.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */



#pragma  once
#include "httpconnection.h"
#include <functional>
#include <string>
#include <unordered_map>
#include "../util/global.h"
#include "../util/singleton.h"

namespace Yizhi {
    class LogicSystem{
        friend class HttpConnection;
        typedef std::function<void(Yizhi::HttpConnection::ptr)> HttpHandler ;
        public:
        
        LogicSystem();
        bool HandleGet(std::string,HttpConnection::ptr);
        void RegGet(std::string,HttpHandler);


        bool HandlePost(std::string,HttpConnection::ptr);
        void RegPost(std::string,HttpHandler);
        ~LogicSystem();
        private:
        std::unordered_map<std::string,HttpHandler> m_gethandler;
        std::unordered_map<std::string,HttpHandler> m_posthandler;


     

    };

    

    typedef Singleton<LogicSystem> Lcsym;
    
}